package com.schoolcloud.front.controller;

import com.schoolcloud.common.model.R;
import com.schoolcloud.front.service.FroRoleService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/front/role")
@RequiredArgsConstructor
public class FroRoleController {
    private final FroRoleService froRoleService;
    @GetMapping("by/{userId}")
    public R<List<String>> getFroRoleCodesByUserId(@PathVariable String userId){
        List<String> list=froRoleService.getFroRoleCodesByUserId(userId);
        return R.ok(list);
    }
}
